package com.liu.fastjson;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author LIU
 * @version 1.0
 * @description TODO
 * @date 2024/4/23 10:49
 */
@Data
public class User {
    private Long id;
    private String name;
    /**
     *  指定属性和key映射关系
     */
    @JSONField(name = "address")
    private String addr;

    /**
     *  不参与序列化
     */
    @JSONField(serialize = false)
    private String pwd;

    private Date registerDate;
    /**
     *  默认时间戳 1713841216666
     *  FastJSON时间格式化
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime birthDay;



    private String test;
}
